package com.example.roomdatabasetest;

import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.PrimaryKey;

@Entity(tableName = "Cars")
public class Car {
    //这个是JavaBean 类
    //设置主键自动生成
    @PrimaryKey(autoGenerate = true)
    @ColumnInfo(name = "car_id")
    private int id;
    @ColumnInfo(name = "car_brand")
    private String brand;
    @ColumnInfo(name = "car_price")
    private int price;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }
}
